package com.efast.dmom.equipment.statemach.handler.maintain;

import com.alibaba.fastjson.JSONObject;
import com.efast.cafe.commponent.statemach.annotation.StatemachHandle;
import com.efast.cafe.commponent.statemach.base.HandleBaseProcessorService;
import com.efast.cafe.framework.jdbc.JdbcDao;
import com.efast.cafe.framework.util.SpringWebUtils;
import com.efast.dmom.equipment.entity.EquipMaintainOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@StatemachHandle(handleName="savedraft",configId=1020,entityName ="equip_maintain_order")
public class EquipMaintainOrderDraftHandler implements HandleBaseProcessorService<EquipMaintainOrder> {


    @Autowired
    private JdbcDao jdbcDao;
    @Override
    public void process(JSONObject taskBean, EquipMaintainOrder bean, Map<String,JSONObject> map) {
        bean.setCreateUser(SpringWebUtils.getRequestUser());
        bean.setCompanyCode(SpringWebUtils.getRequestCompany());
       bean.setOrdernumber(jdbcDao.executeProcGetCode("BY",SpringWebUtils.getRequestCompany()));

    }
}
